<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class VoucherResource extends JsonResource
{
    public function toArray($request)
    {
        return [
//                'user_name' => $this->user()->value('name')
                'user_name' => $this->user()->pluck('name')->first()
            ] + parent::toArray($request);
    }
}
